Skip to content

fix: clip CJK split rows by terminal cell width#287

Open
iamken1204 wants to merge 2 commits into
modem-dev:mainfrom
iamken1204:fix-diff-cjk-content
Open

fix: clip CJK split rows by terminal cell width#287
iamken1204 wants to merge 2 commits into
modem-dev:mainfrom
iamken1204:fix-diff-cjk-content

Conversation

@iamken1204
Copy link
Copy Markdown
Contributor

Fixes split-view rendering for long CJK lines, especially untracked files with Mandarin content, where mouse-wheel repainting could let wide characters spill past the right split pane into the left side.

Changes:

  • Measure diff code and UI text by terminal cell width instead of UTF-16 string length.
  • Slice, pad, wrap, and horizontally scroll styled diff spans without splitting fullwidth characters.
  • Add Mandarin-only long-line regression coverage for mouse-wheel split-view repainting.
  • Add Japanese and Korean unit coverage for CJK width and clipping behavior.

Before
CleanShot 2026-05-11 at 15 39 40@2x

After
CleanShot 2026-05-11 at 15 39 59@2x

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant